hsc

Absolute URIs

Let's asume this directory structure for your html-project:
     prj/
     |
     +-image/
     | |
     | +-back.gif
     | |
     | +-logo.gif
     |
     +-people/
     | |
     | +-hugo.html
     | |
     | +-hugo.gif
     | |
     | :
     |
     +-main.html
If e.g. "main.html" wants to refer to "logo.gif", the situation is quite clear: Insert a
<IMG SRC="image/logo.gif">
in "main.html", and the logo will appear. But what if "hugo.html" will display the same logo? With relative URIs (as supported by html), you will have to insert a
<IMG SRC="../image/logo.gif">
And a file located another directory lever deeper will have to use "../../image/logo.gif" as path. Within big projects, this becomes very annoying because you always have to know in which directory level the file you are currently editing is located.

With absolute URIs, you can always use

<IMG SRC="image/logo.gif">
even from a file called e.g "people/ugly/blond/tall/sepp.html".

This becomes even more useful with macros: for example, you could write a macro that inserts a button refering to your main page:

<$MACRO BUTTON_MAIN>
<A HREF="main.html">
<IMG SRC="image/main.gif" ALT="Main">
</A>
</$MACRO>
So you can add a button to your mainpage by simply using
<BUTTON_MAIN>
in any file of your project. And, that's the feature, independent of the location in the directory path of the calling file.

Well, maybe the term "absolut URI" is not really correct. Absolut URIs don't refer to absolut paths on your local disk. The refer relative to the main directory of your project. Usually, this is the directory where your makefile is located and therefor hsc is envoked from. Everything clear now?

Of course, in the destination HTML-file, all absolute URIs are converted to relativ URIs.

To work with absolut URIs, enable the AbsUri switch.

MAIN PREV NEXT


Thomas Aglassinger ( agi@sbox.tu-graz.ac.at ), 09-Oct-1995, 10:59